//
//  WFComposeMenuBtn.swift
//  WangFangWeiBo
//
//  Created by 王方 on 16/7/16.
//  Copyright © 2016年 wf. All rights reserved.
//

import UIKit

class WFComposeMenuBtn: UIButton {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setUpUI(){
        titleLabel?.font = UIFont.systemFontOfSize(15)
        setTitleColor(UIColor.grayColor(), forState: .Normal)
        titleLabel?.textAlignment = .Center
        
    }
    
    //重写highlight属性
    override var highlighted: Bool {
        get {
            return false
        }
        set {
            
        }
    }
    
    //布局子控件
    override func layoutSubviews() {
        super.layoutSubviews()
        //  设置子控件的宽高
        imageView?.y = 0
        imageView?.width = width
        imageView?.height = width
        
        titleLabel?.x = 0
        titleLabel?.y = width
        titleLabel?.width = width
        titleLabel?.height = height - width

    }

}
